package com.csu.letaobackend.commom;

import com.csu.letaobackend.vo.ItemVO;

import java.util.Comparator;

public class SortBySales implements Comparator {

      public int compare(Object o1, Object o2) {

            ItemVO p1 = (ItemVO) o1;
            ItemVO p2 = (ItemVO) o2;
            if (p1.getSales() > p2.getSales())
                  return 1;
            else if (p1.getSales() == p2.getSales())
                  return 0;
            else
                  return -1;
      }
}
